package com.ldzg.blockwatcher.risk.rules;

import org.springframework.stereotype.Service;

import java.util.Collections;
import java.util.Set;

/**
 * @author 18310740596@163.com
 * @version V1.0.0
 * @since 2025-07-05 11:47:22
 */
@Service
public class AddressLabelService {

    // 在实际应用中,这些地址应该从数据库或配置文件中加载
    private static final Set<String> CEX_ADDRESSES = Set.of("0xcex1...");
    private static final Set<String> MIXER_ADDRESSES = Set.of("0xmixer1...");
    private static final Set<String> SCAM_ADDRESSES = Set.of("0xscam1...");
    private static final Set<String> BLACKLIST_ADDRESSES = Set.of("0xblacklist1...");

    public Set<String> getAddresses(AddressType type) {
        return switch (type) {
            case EXCHANGE -> CEX_ADDRESSES;
            case MIXER -> MIXER_ADDRESSES;
            case SCAM -> SCAM_ADDRESSES;
            case BLACKLIST -> BLACKLIST_ADDRESSES;
        };
    }

    public boolean isAddressType(String address, AddressType type) {
        return getAddresses(type).contains(address);
    }
}